<?php

namespace Xin\Hyperf\Fortify\Model;

trait AsJson
{
    /**
     * Encode the given value as JSON.
     */
    protected function asJson(mixed $value): false|string
    {
        return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
    }
}
